package org.jeecg.module.flow.meter.tcpserver.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("ft_meter_device")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MeterDevice implements Serializable {

    private static final long serialVersionUID = 188L;

    /**水表id*/
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**表身号*/
    private String meterNumber;

    /**imei*/
    private String imei;

    /**imsi*/
    private String imsi;

    /**ICCID*/
    private String iccId;

    /**设备ID*/
    private String deviceId;

    private Integer valveStatus;

    /**强磁异常*/
    private Integer magneticStatus;

    /**阀门故障异常*/
    private Integer faultStatus;

    private Integer forceStatus;

    private Integer signalValue;

    private Double temperature;

    private Double amount;

    private Double voltage;

    /**创建时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date lastUploadTime;

    /**创建人*/
    private String createBy;

    private Integer meterCaliber;

    private Integer factoryType;

    private Integer decimalNum;

    private Integer meterType;

    private Integer registerPlat;

    private String tenantId;

    private String flowJson; //流量计json

    @TableField(exist = false)
    private BigDecimal lastAmount;

    @TableField(exist = false)
    private String meterStatusCode; //表状态码
}

